package com.file.system.service.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.file.system.entity.res.DataPage;
import com.file.system.entity.system.WebDepartment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* 部门 服务类
* @author jch
* @since 2022-08-04
*/
public interface IWebDepartmentService{

    //添加部门
    boolean save(WebDepartment webDepartment);

    //删除部门
    boolean removeById(@Param("id") Long id);

    //编辑部门
    boolean updateById(@Param("et")WebDepartment webDepartment);

    //编辑
    int update(@Param("ew") UpdateWrapper<WebDepartment> query);

    //添加部门(批量)
    int saveBatch(@Param("list") List<WebDepartment> webDepartmentList);

    //查询部门
    List<WebDepartment> list(@Param("ew") QueryWrapper<WebDepartment> query);

    //通过ids查询部门集合
    List<WebDepartment> listByIds(List<Long> ids);

    //查询所有非删除状态部门
    List<WebDepartment> listAll();

    //查询部门分页
    DataPage<List<WebDepartment>> page(@Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize, @Param("ew") QueryWrapper<WebDepartment> query);

    //通过id查询部门
    WebDepartment getById(@Param("id") Long id);

    //通过条件查询部门
    WebDepartment getOne(@Param("ew") QueryWrapper<WebDepartment> query);

    //查询部门数量
    int count(@Param("ew") QueryWrapper<WebDepartment> query);


}
